//
//  JSExpViewCell.swift
//  fho
//
//  Created by 郭颢源 on 2021/4/10.
//

import UIKit

class JSExpViewCell: UITableViewCell {
     var imgView = UIImageView()
     var line = UIView()
     var content = UILabel()
     var timeLab = UILabel()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
//        content.preferredMaxLayoutWidth = 200
        line.backgroundColor = .systemGray
        timeLab.textColor = .systemGray2
        timeLab.numberOfLines = 0
        
        content.textColor = .systemGray
        imgView.image = UIImage(named: "arrTop")
        imgView.backgroundColor = .white
        imgView.layer.cornerRadius = 10
        imgView.layer.masksToBounds = true
        content.numberOfLines = 0
        contentView.addSubview(line)
        contentView.addSubview(imgView)
        contentView.addSubview(content)
        contentView.addSubview(timeLab)
        timeLab.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(5)
            make.left.equalToSuperview().offset(20)
            make.bottom.equalToSuperview().offset(-5)
            make.width.equalTo(90)
        }
        imgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(10)
            make.left.equalTo(timeLab.snp.right).offset(3)
            make.width.height.equalTo(20)
        }
        line.snp.makeConstraints { (make) in
            make.top.bottom.equalToSuperview()
            make.width.equalTo(1)
            make.centerX.equalTo(imgView)
        }

        
        content.snp.makeConstraints { (make) in
            make.left.equalTo(imgView.snp.right).offset(3)
            make.right.equalToSuperview().offset(-20)
            make.top.equalToSuperview().offset(5)
            make.bottom.equalToSuperview().offset(-5)
        }
        
//        contentView.showSubviews()

    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
        // Configure the view for the selected state
    }
    
}
